$(function() {
    $(".ul-nav").delegate("li", "click", function(e) {
        var e = e || event;
        if (e.target.className != 'ul-nav-li-title') {
            return;
        }
        var index = $(this).index();
        $(".ul-nav-li").removeClass('active');
        $(this).addClass('active');
        $(".ul-container>li").hide().eq(index).show();
    });
});
var token = "75659B1E6EC27831DD8DE4162DFE7F16D8BAD016801824768FC45B03CB91A8BF";

function myPost(url, data, callback) {
    $.ajax({
        type: "post",
        url: url,
        data:data,
        beforeSend: function(XMLHttpRequest) {
            //XMLHttpRequest.setRequestHeader("xxxx", token)
        },
        success: function(data, textStatus,jqxhr) {            
            jqxhr.getResponseHeader("xxxx");
            callback(data)
        },
        dataType: "json"
    })
}

function myGet(url, data, callback) {
    $.ajax({
        type: "get",
        url: url,
        beforeSend: function(XMLHttpRequest) {
            //XMLHttpRequest.setRequestHeader("xxxx", token)
        },
        success: function(data, textStatus,jqxhr) {
            jqxhr.getResponseHeader("xxxx");
            callback(data)
        },
        dataType: "json"
    })
}
function fromatDate(time){
    return time;
    // if(!time){
    //     return '';
    // }
    // var res = time.split('').reverse().slice(8).reverse().join('');
    // return res;
}
//正整数
function isPInt(str) {
    var g = /^[1-9]*[1-9][0-9]*$/;
    return g.test(str);
}
//整数
function isInt(str)
{
    var g=/^-?\d+$/;
    return g.test(str);
}
function isPhoneNumber(value){
    var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
    var isMob = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
    if(isMob.test(value)||isPhone.test(value)){
        return true;
    }
    else{
        return false;
    }
}
function isEmail(value){    
    var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
    return reg.test(value);
}
window.initDropdownList = undefined;
(function(){
	$.get(GetInitDropdownList,function(data){
		if(data.Status == true){
			window.initDropdownList = data.Message;
		}
	},'json');
    $.get(getUserInfo,function(data){
        if(data.Status == true){
            window.userInfo = data.Message;
        }
    },'json');
})();

